<template>
  <div>

    <el-row class="bread-nav">
      <ul class="bread-nav-title">
        <span>{{infoParent.class}}级{{form.type==1?'':'会员'}}->{{opera=="edit"?"修改":"新增"}}</span>
      </ul>

      <ul class="bread-nav-content-right">
        <a class="back" @click="goBack">返回</a>
      </ul>
    </el-row>
    <el-form class="set-user-form" status-icon ref="form" :model="form" :rules="rules"
             :inline-message="true" label-width="300px" size="mini">
      <!--<div>-->
        <!--<el-tag class="card-header">{{infoParent.level+1}}级{{form.type==1?'代理':'会员'}}->{{opera=="edit"?"修改":"新增"}}</el-tag>-->
      <!--</div>-->

        <el-row class="form-up-title">
          账户资料
        </el-row>

      <!--勿删！！
          勿删！！
          勿删！！ 代理系统时需要使用-->
        <!--<el-form-item :label="infoParent.class+'账号'">-->
          <!--{{infoParent.username}}-->
        <!--</el-form-item>-->

      <el-form-item label="上级">
        公司
      </el-form-item>


      <!--勿删！！
                勿删！！
                勿删！！ 代理系统时需要使用-->
        <!--<el-form-item prop="username" :label="(parseInt(infoParent.level)+1)+`级${userTypeName}账号`">-->
      <el-form-item prop="username" label="账号">
          <el-input type="text" placeholder="字母和数字组合" clearable v-model="form.username" :disabled="opera=='edit'"></el-input>
          <el-radio-group v-model="form.status" size="small" v-if="opera === 'edit'">
            <el-radio-button v-for="(item,index) in userMap.status" :label="index" :key="`userStatus${index}`">{{item}}</el-radio-button>
          </el-radio-group>
        </el-form-item>

        <el-form-item prop="user_auth_key" :label="requireAuth === true ?'登入密码':'输入新密码'">
          <el-input type="text" placeholder="6-10位字母或数字" clearable v-model="form.user_auth_key"></el-input>
        </el-form-item>

      <!--勿删！！
          勿删！！
          勿删！！ 代理系统时需要使用-->
        <!--<el-form-item prop="nickname" :label="(parseInt(infoParent.level)+1)+`级${userTypeName}名称`">-->
      <el-form-item prop="nickname" label="名称">
          <el-input type="text" placeholder="6-10位字母或数字" clearable v-model="form.nickname"></el-input>
        </el-form-item>

      <!--勿删！！
          勿删！！
          勿删！！ 庄家系统时需要使用-->
      <el-form-item label="代理模式">
        <el-radio v-model="form.reset_mode" :label="1">信用模式</el-radio>
        <el-radio v-model="form.reset_mode" :label="2">现金模式</el-radio>
        <el-radio v-model="form.reset_mode" :label="3">信用+现金模式</el-radio>
      </el-form-item>

      <!--勿删！！
          勿删！！
          勿删！！ 代理系统时需要使用-->
      <!--庄家系统不需要infoParent.qk_cash_amount/1
      (上级余额:{{infoParent.hk_cash}})
      以下同理
      -->
      <!--<el-form-item prop="qk_cash_amount" label="快开彩现金额度" v-if="infoParent.deal_mode == 1 || infoParent.deal_mode == 3">-->
      <el-form-item prop="qk_cash_amount" label="快开彩现金额度" v-if="form.reset_mode == 1 || form.reset_mode == 3">
      <!-- 如果是新增用户,额度在上级额度剩余区间 -->
          <div v-if="opera == 'add'">
            <el-input-number size="small" v-model="form.qk_cash_amount" :min=0 :max="infoParent.qk_cash_amount/1"></el-input-number> (上级余额:{{infoParent.hk_cash}})
          </div>
          <div v-if="opera == 'edit'">
            <el-input-number size="small" v-model="form.qk_cash_amount" :min=0 :max="infoParent.qk_cash_amount/1+infoUser.hk_cash/1"></el-input-number> (上级余额:{{infoParent.qk_cash}},自身余额:{{infoUser.qk_cash_amount}})
          </div>
        </el-form-item>
      <!--勿删！！
          勿删！！
          勿删！！ 代理系统时需要使用-->
        <!--<el-form-item prop="qk_credit_amount" label="快开彩信用额度"v-if="infoParent.deal_mode == 2 || infoParent.deal_mode == 3">-->
      <el-form-item prop="qk_credit_amount" label="快开彩信用额度" v-if="form.reset_mode == 2 || form.reset_mode == 3">
      <!-- 如果是编辑用户,额度在上级额度剩余区间 + 自身额度余额 -->
          <div v-if="opera == 'add'">
            <el-input-number size="small" v-model="form.qk_credit_amount" :min=0 :max="infoParent.qk_credit_amount/1"></el-input-number> (上级余额:{{infoParent.qk_credit}})
          </div>
          <div v-if="opera == 'edit'">
            <el-input-number size="small" v-model="form.qk_credit_amount" :min=0 :max="infoParent.qk_credit_amount/1+infoUser.qk_credit/1"></el-input-number> (上级余额:{{infoParent.qk_credit}},自身余额:{{infoUser.qk_credit}})
          </div>
          </el-form-item>
      <!--勿删！！
                勿删！！
                勿删！！ 代理系统时需要使用-->
        <!--<el-form-item prop="hk_cash_amount" label="香港彩现金额度" v-if="infoParent.deal_mode == 1 || infoParent.deal_mode == 3">-->
      <el-form-item prop="hk_cash_amount" label="香港彩现金额度" v-if="form.reset_mode == 1 || form.reset_mode == 3">
         <div v-if="opera == 'add'">
            <el-input-number size="small" v-model="form.hk_cash_amount" :min=0 :max="infoParent.hk_cash_amount/1"></el-input-number> (上级余额:{{infoParent.hk_cash}})
          </div>
          <div v-if="opera == 'edit'">
            <el-input-number size="small" v-model="form.hk_cash_amount" :min=0 :max="infoParent.hk_cash_amount/1+infoUser.hk_cash_amount/1"></el-input-number> (上级余额:{{infoParent.hk_cash}},自身余额:{{infoUser.hk_cash_amount}})
          </div>
        </el-form-item>
      <!--勿删！！
          勿删！！
          勿删！！ 代理系统时需要使用-->
        <!--<el-form-item prop="hk_credit_amount" label="香港彩信用额度" v-if="infoParent.deal_mode == 2 || infoParent.deal_mode == 3">-->
      <el-form-item prop="hk_credit_amount" label="香港彩信用额度" v-if="form.reset_mode == 2 || form.reset_mode == 3">
          <div v-if="opera == 'add'">
            <el-input-number size="small" v-model="form.hk_credit_amount" :min=0 :max="infoParent.hk_credit_amount/1"></el-input-number> (上级余额:{{infoParent.hk_credit}})
          </div>
          <div v-if="opera == 'edit'">
            <el-input-number size="small" v-model="form.hk_credit_amount" :min=0 :max="infoParent.hk_credit_amount/1+infoUser.hk_credit_amount/1"></el-input-number> (上级余额:{{infoParent.hk_credit}},自身余额:{{infoUser.hk_credit}})
          </div>
        </el-form-item>

      <!--勿删！！
          勿删！！
          勿删！！ 代理系统时需要使用-->
        <!--<el-form-item prop="handicaps" label="开放盘口">-->
          <!--&lt;!&ndash; 如果是代理,根据父级handicaps数组多选 &ndash;&gt;-->
          <!--<el-checkbox-group v-model="form.handicaps" v-if="form.type == 1">-->
            <!--<el-checkbox v-for="item in infoParent.handicaps" :label="item" :key="`agentHandicapsCheckbox${item}`">{{userMap.handicaps[item]}}盘</el-checkbox>-->
          <!--</el-checkbox-group>-->
          <!--<el-radio-group v-model="form.handicaps" v-if="form.type == 2">-->
            <!--&lt;!&ndash; 如果是会员,根据父级的handicaps单选 &ndash;&gt;-->
            <!--<el-radio v-for="item in infoParent.handicaps" :label="item" :key="`memberHandicapsRadio${item}`">{{userMap.handicaps[item]}}盘</el-radio>-->
          <!--</el-radio-group>-->
        <!--</el-form-item>-->

      <el-form-item prop="handicaps" label="开放盘口">
        <el-checkbox-group v-model="form.handicaps">
          <el-checkbox v-for="item in userMap.handicaps" :label="item" :key="`agentHandicapsCheckbox${item}`">{{item}}盘</el-checkbox>
        </el-checkbox-group>
      </el-form-item>

      <!--勿删！！
                勿删！！
                勿删！！ 庄家系统时需要使用-->
        <el-form-item prop="control_odds" label="调整赔率差">
          <el-switch active-value='0' inactive-value='1'
                     v-model="form.control_odds" :disabled="hasOrder"
                     active-text="开放"
                     inactive-text="禁止">
          </el-switch>
        </el-form-item>

      <!--勿删！！
                      勿删！！
                      勿删！！ 庄家系统时需要使用-->
        <el-form-item prop="replenishment_share_mode" label="补货占成模式">
          <el-radio-group v-model="form.replenishment_share_mode" :disabled="hasOrder">
            <el-radio v-for="(item,index) in userMap.replenishment_share_mode" :label="index" :key="`ReplenishmentShareModeRadio${index}`">{{item}}</el-radio>
          </el-radio-group>
        </el-form-item>

      <!--勿删！！
                      勿删！！
                      勿删！！ 庄家系统时需要使用-->
        <el-form-item prop="left_share_owner" label="剩余成数归属">
          <el-radio-group v-model="form.left_share_owner" :disabled="hasOrder">
            <el-radio v-for="(item,index) in userMap.left_share_owner" :label="index" :key="`LeftShareOwnerRadio${index}`">{{item}}</el-radio>
          </el-radio-group>
        </el-form-item>

        <el-form-item prop="earn_commission" label="赚取退水">
          <el-select v-model="form.earn_commission" placeholder="选择退水比例">
            <el-option v-for="item  in userMap.earn_commission" :label="Object.values(item)[0]" :key="`EarnCommission${Object.keys(item)[0]}`" :value="Object.keys(item)[0]">
            </el-option>
          </el-select>
        </el-form-item>

      <el-row class="form-up-title">
        占成设置
      </el-row>

      <table class="table-bottom">
        <thead>
          <tr>
            <th :rowspan="form.type == 1?2:1">
              类型
            </th>
            <th v-if="form.type == 1" :rowspan="form.type == 1?2:1">
              <!--勿删！！
                    勿删！！
                    勿删！！ 代理系统时需要使用-->
              <!--{{infoParent.class}}最高占成-->
              公司最高占成
            </th>
            <th :colspan="form.type == 1?2:1">
              <!--勿删！！
                    勿删！！
                    勿删！！ 代理系统时需要使用-->
              <!--{{form.type == 1?parseInt(infoParent.level)+1+'级代理':'代理'}}占成-->
              一级代理占成
            </th>
            <th v-if="form.type != 1">
              {{form.type == 1?'占成条件':'可分配占成'}}
            </th>
            <th v-if="form.type == 1" :rowspan="form.type == 1?2:1">
              开放补货
            </th>
            <th v-if="form.type == 1" :rowspan="form.type == 1?2:1">
              拦截补货
            </th>
          </tr>
        <tr v-if="form.type == 1">
          <th>
            最高（%）
          </th>
          <th>
            最低（%）
          </th>
        </tr>
        </thead>

      <tbody>
      <tr>
        <th>
          快开彩种
        </th>
        <td>
          <el-input-number size="mini" v-model="form.qk_upper_level_share" :min=0 :max=infoParent.qk_upper_share/1-form.qk_self_share></el-input-number>%
        </td>
        <td  v-if="form.type==1">
          <el-input-number size="mini" v-model="form.qk_self_min_share" :min=0 :max=infoParent.qk_upper_share/1-form.qk_self_min_share></el-input-number>%
        </td>
        <td  v-if="form.type==1">
          <el-input-number size="mini" v-model="form.qk_self_max_share" :min=0 :max=infoParent.qk_upper_share/1-form.qk_self_max_share></el-input-number>%
        </td>
        <td v-if="form.type != 1">
          ( 0% 至 {{infoParent.qk_upper_share}}% )
        </td>
        <td v-if="form.type == 1">
          <el-switch
            active-value='1'
            inactive-value='0'
            @change="handleQkOpen"
            v-model="form.qk_open_replenishment"
            active-text="开放"
            inactive-text="禁止">
          </el-switch>
        </td>
        <td v-if="form.type == 1">
        <el-switch
          active-value='1'
          inactive-value='0'
          @change="handleQkOpen"
          v-model="form.qk_catch_replenishment"
          active-text="开放"
          inactive-text="禁止">
        </el-switch>
        </td>
      </tr>
      </tbody>

        <tbody>
        <tr>
          <th>
            香港彩种
          </th>
          <td>
            <el-input-number size="mini" v-model="form.hk_upper_level_share" :min=0 :max=infoParent.hk_upper_share/1-form.hk_upper_level_share></el-input-number>%
          </td>
          <td  v-if="form.type==1">
            <el-input-number size="mini" v-model="form.hk_self_min_share" :min=0 :max=infoParent.hk_upper_share/1-form.hk_self_min_share></el-input-number>%
          </td>
          <td  v-if="form.type==1">
            <el-input-number size="mini" v-model="form.hk_self_max_share" :min=0 :max=infoParent.hk_upper_share/1-form.hk_self_max_share></el-input-number>%
          </td>
          <td v-if="form.type != 1">
            ( 0% 至 {{infoParent.hk_upper_share}}% )
          </td>
          <td v-if="form.type == 1">
            <el-switch
              active-value='1'
              inactive-value='0'
              @change="handleQkOpen"
              v-model="form.hk_open_replenishment"
              active-text="开放"
              inactive-text="禁止">
            </el-switch>
          </td>
          <td v-if="form.type == 1">
          <el-switch
            active-value='1'
            inactive-value='0'
            @change="handleQkOpen"
            v-model="form.hk_catch_replenishment"
            active-text="开放"
            inactive-text="禁止">
          </el-switch>
          </td>
        </tr>
        </tbody>

      </table>

    </el-form>

    <div class="baseOdd-bottom">
      <button @click="onSubmit">确认</button>
      <button @click="onReset">重置</button>
    </div>

  </div>
</template>

<script>
import { user as userMap } from '@/utils/map' // 参数映射

export default {
  data() {
    return {
      infoParent: {}, // 父级账号信息
      infoUser: {}, // 新增或待编辑账号信息
      userMap: userMap,
      opera: null, // 操作:新增,修改
      userTypeName: null, // 代理,会员
      loading: false,
      qkCatckDisabled: false, // 拦截switch
      hkCatckDisabled: false, // 拦截switch
      hasOrder: false, // 是否已经投标
      form: {
        username: '',
        nickname: '',
        type: 1, // 默认1:agent,2:member
        status: 1,
        user_auth_key: '',
        handicaps: [],
        qk_upper_level_share: 0,
        qk_cash_amount: 0,
        qk_credit_amount: 0,
        qk_open_replenishment: '1',
        qk_catch_replenishment: '0', // 拦截
        qk_self_min_share: 0,
        qk_self_max_share: 0,
        hk_upper_level_share: 0,
        hk_self_min_share: 0,
        hk_self_max_share: 0,
        hk_cash_amount: 0,
        hk_credit_amount: 0,
        hk_open_replenishment: '1',
        hk_catch_replenishment: '0', // 拦截
        earn_commission: null, // 赚取退水
        p_agntname: '', // 非必须 本来是p_agentname，接口那里写错了，就顺着他们写错吧
        reset_mode: 1, // 非必须1:现金,2信用
        left_share_owner: '1', // 剩余成数归属
        control_odds: '1', // 调整赔率差
        replenishment_share_mode: '1', // 补货占成模式
      },
      rules: {
        username: [
          {
            type: 'string',
            required: true,
            trigger: 'blur',
            message: '请输入账号',
            transform(value) {
              return value.trim()
            },
          },
          {
            min: 5,
            message: '最少包含5个字符',
            trigger: 'change',
          },
          {
            pattern: /^[a-zA-Z0-9]+$/,
            trigger: 'blur',
            message: '只能输入英文字符和数字',
          },
        ],
        nickname: [
          {
            type: 'string',
            required: true,
            trigger: 'blur',
            message: '请输入名称',
            transform(value) {
              return value.trim()
            },
          },
          {
            min: 5,
            message: '最少包含5个字符',
            trigger: 'change',
          },
          {
            pattern: /^[a-zA-Z0-9]+$/,
            trigger: 'blur',
            message: '只能输入英文字符和数字',
          },
        ],
        user_auth_key: [
          {
            type: 'string',
            required: true, // 新增时需要密码
            trigger: 'blur',
            message: '请输入密码',
          },
          {
            min: 6,
            message: '最少包含6个字符',
            trigger: 'change',
          },
          {
            pattern: /^[a-zA-Z0-9]+$/,
            trigger: 'blur',
            message: '只能输入英文字符和数字',
          },
        ],
        qk_cash_amount: [
          {
            type: 'number',
            required: true,
            trigger: 'blur',
            message: '请输入快开彩现金额度',
          },
        ],
        hk_cash_amount: [
          {
            type: 'number',
            required: true,
            trigger: 'blur',
            message: '请输入香港彩现金额度',
          },
        ],
        qk_credit_amount: [
          {
            type: 'number',
            required: true,
            trigger: 'blur',
            message: '请输入快开彩信用额度',
          },
        ],
        hk_credit_amount: [
          {
            type: 'number',
            required: true,
            trigger: 'blur',
            message: '请输入香港彩信用额度',
          },
        ],
        handicaps: [
          {
            required: true,
            trigger: 'change',
            message: '请选择开放盘口',
          },
        ],
        earn_commission: [
          {
            type: 'enum',
            enum: userMap.earn_commission.map(item => {
              return Object.keys(item)[0]
            }),
            required: true,
            trigger: 'change',
            message: '请选择赚取退水',
            // transform(value) {
            //   return parseInt(value, 10);
            // }
          },
        ],
      },
    }
  },
  computed: {
    requireAuth() {
      return this.opera === 'add'
    },
  },
  created() {
    this.checkParams()
    console.log(typeof this.requireAuth, this.requireAuth, this.opera)
  },
  methods: {
    goBack() {
      this.$router.go(-1)
    },
    onSubmit() {
      this.$refs.form.validate(valid => {
        if (valid) {
          this.form.username = this.form.username.trim()
          this.form.nickname = this.form.nickname.trim()
          this.form.user_auth_key = this.form.user_auth_key.trim()
          this.loading = true
          // 新增代理
          const dispatch = {
            validate: 'ValidateAgent',
            set: 'CreateAgent',
            payload: { AgentForm: this.form },
          }
          // 根据type,操作发送到不同接口
          if (this.opera === 'add' && this.form.type === 2) {
            // 新增会员
            dispatch.validate = 'ValidateMember'
            dispatch.set = 'CreateMember'
            dispatch.payload = { MemberForm: this.form }
          } else if (this.opera === 'edit' && this.form.type === 1) {
            // 更新代理
            dispatch.validate = 'ValidateUpdateAgent'
            dispatch.set = 'UpdateAgent'
            dispatch.payload = { AgentUpdateForm: this.form }
          } else if (this.opera === 'edit' && this.form.type === 2) {
            // 更新会员
            dispatch.validate = 'ValidateUpdateMember'
            dispatch.set = 'UpdateMember'
            dispatch.payload = { MemberUpdateForm: this.form }
          }

          this.$store
            .dispatch(dispatch.validate, dispatch.payload)
            .then(response => {
              this.loading = false
              this.errorMsg = ''
              if (response.length === 0) {
                // 服务端验证通过
                this.$store
                  .dispatch(dispatch.set, dispatch.payload)
                  .then(res => {
                    if (typeof res === 'number') {
                      // 新增成功成功
                      this.$message({
                        message: '新增成功!',
                        type: 'success',
                      })
                      // const newId = parseInt(res) // 新代理id
                      // 跳转到退水设置
                      // 跳转到 list
                      // this.$router.push({ path: "/change-pwd" });
                      this.$router.go(-1)
                    } else if (res === true) {
                      // 编辑成功
                      this.$message({
                        message: '更新成功!',
                        type: 'success',
                      })
                      this.$router.go(-1) // 返回上一页
                    } else {
                      this.$message({
                        message: Object.values(res)[0].toString(),
                        type: 'error',
                      })
                    }
                  })
              } else {
                // 验证失败
                this.$message({
                  message: Object.values(response)[0].toString(),
                  type: 'error',
                })
              }
            })
        } else {
          return false
        }
      })
    },
    // 重置信息
    onReset() {
      // 返回列表
      this.$refs.form.resetFields()
      this.$message({
        message: '数据已重置!',
        type: 'warning',
      })
    },
    // 验证参数
    checkParams() {
      // 用户
      this.form.p_agentname = this.$route.params.parent
      this.form.type = this.$route.params.type
      this.userTypeName = parseInt(this.$route.params.type) === 1 ? '代理' : '会员'
      this.opera = this.$route.params.opera // 操作
      this.getInfoParent()
    },

    // 验证是否已有投标
    checkHasOrder() {
      this.$store
        .dispatch('HasOrder', { username: this.$route.params.username })
        .then(response => {
          this.hasOrder = response
        })
    },

    // 查询对应agentName的账号信息
    getInfoParent() {
      this.loading = true
      this.$store
        .dispatch('GetUserInfo', { username: this.form.p_agentname })
        .then(response => {
          this.loading = false
          this.infoParent = response
          // 将,号字符转换成数组,用于radio的遍历输出
          if (typeof response.handicaps === 'string') {
            this.infoParent.handicaps = response.handicaps.split(',')
          }
          if (this.opera === 'edit') {
            // 将infoParent赋值给form
            this.getInfoUser()
          }
          console.log('查询对应agentName的账号信息', this.infoParent)
        })
    },
    // 当编辑时,获取用户数据
    getInfoUser() {
      this.$store
        .dispatch('GetUserInfo', { username: this.$route.params.username })
        .then(response => {
          this.infoUser = response // 保存用户信息
          // 将要修改的用户信息赋值给form对应的字段
          if (response.type === 1) {
            // 代理的盘口要转换为数组,多选.  会员是单选,是字符
            this.form.handicaps = response.handicaps.split(',')
          } else {
            this.form.handicaps = response.handicaps.toString() // 注意将number转换成string,否则控件取值不能匹配
          }
          this.form.username = response.username
          this.form.nickname = response.nickname
          this.form.status = response.status.toString()
          this.form.qk_upper_level_share = response.qk_upper_level_share
          this.form.qk_self_share = response.qk_self_share
          this.form.qk_lottery_amount = response.qk_lottery_amount
          this.form.hk_upper_level_share = response.hk_upper_level_share
          this.form.hk_self_share = response.hk_self_share
          this.form.hk_lottery_amount = response.hk_lottery_amount
          this.form.earn_commission = parseFloat(response.earn_commission, 10)

          // switch 值不认 number的值,所以要转换成string
          this.form.qk_open_replenishment = response.qk_open_replenishment.toString()
          this.form.hk_open_replenishment = response.hk_open_replenishment.toString()
          this.form.qk_catch_replenishment = response.qk_catch_replenishment.toString()
          this.form.hk_catch_replenishment = response.hk_catch_replenishment.toString()
          this.handleQkOpen(this.form.qk_open_replenishment) // 根据获取的值,处理拦截的按钮
          this.handleHkOpen(this.form.hk_open_replenishment)

          // 验证是否已经下单
          this.checkHasOrder()
        })
    },
    // qkopen,hkopen 变化打开时,拦截可以操作.  当打开关闭时,拦截一起关闭
    handleQkOpen(value) {
      if (parseInt(value) === 1) {
        // 打开
        this.qkCatckDisabled = false
      } else {
        // 关闭
        this.qkCatckDisabled = true
        this.form.qk_catch_replenishment = '0' // 同时关闭
      }
    },
    handleHkOpen(value) {
      if (parseInt(value) === 1) {
        // 打开
        this.hkCatckDisabled = false
      } else {
        // 关闭
        this.hkCatckDisabled = true
        this.form.hk_catch_replenishment = '0' // 同时关闭
      }
    },
  },
}
</script>

<style scoped>
.set-user-form .el-row {
}
.set-user-form .el-col {
  text-align: center;
}
.set-user-form .card-header {
  width: 100%;
  padding-left: 50px;
  border-bottom: 0;
}

.bread-nav{
  height:30px;
  font-size: 13px;
  line-height: 30px;
  background: #ECEFF2;
  border-bottom: 1px solid #d0dff2;
  padding: 0 0 0 10px;
  overflow: hidden;
}
.bread-nav-title{
  color:#386399;
  font-weight: bold;
  float: left;
  background: url("../../../../static/agent/img/tb.png") no-repeat left center;
  padding-left: 20px;
}
.bread-nav-content-right{
  float: right;
}
.bread-nav-content-right .back{
  border:0;
  background:url(/static/agent/img/ico_back.png) no-repeat left 8px;
  color:#386399;
  display: block;
  font-weight: bold;
  margin-right: 10px;
  padding: 0 0 0 20px;
}
.bread-nav-content-right .back:hover{
  text-decoration: underline;
}

  .set-user-form{
    padding: 10px;
  }
  .set-user-form .el-form-item{
    margin: 0 !important;
    line-height: 25px;
    font-size:13px;
    border-bottom: 1px solid #b9c2cb;
    border-left: 1px solid #b9c2cb;
    border-right: 1px solid #b9c2cb;
    height:30px;
  }
  .set-user-form .el-input-number{
    height:25px;
  }
.set-user-form .el-input {
  min-width: 150px;
  max-width: 300px;
  width: 50%;
  height:25px;
}
.set-user-form .el-form-item .el-form-item__content{
  border-left: 1px solid #b9c2cb;
}
  .form-up-title{
    line-height: 25px;
    font-size:13px;
    text-align: center;
    font-weight: bold;
    color:#131950;
    background: url(/static/agent/img/table_head.gif) repeat-x;
    border: 1px solid #b9c2cb;
    margin-top: 2px;
  }

.set-user-form .el-row{
  height:25px;
  line-height: 25px;
}

  .table-bottom{
    width: 100%;
    collapse: 0;
    border-collapse: collapse;
    border-spacing: 0;
  }
.table-bottom th{
  /*background: url(/static/agent/img/table_head.gif) repeat-x;*/
  border: 1px solid #b9c2cb;
  line-height: 25px;
  font-size:13px;
  text-align: center;
  font-weight: bold;
  color: #344b50;
  background: #F2F2F2;
}
  .table-bottom td{
    border: 1px solid #b9c2cb;
    line-height: 25px;
    font-size:13px;
    text-align: center;
  }

.baseOdd-bottom{
  text-align: center;
  margin-top: 20px !important;
}
.baseOdd-bottom button{
  width: 86px;
  height: 31px;
  line-height: 26px;
  color: #eeeeee;
  border: 0;
  background-color: #487BD1;
  border-radius: 5px;
}
.baseOdd-bottom button:hover{
  background-color: #7bb1d0;
  color:#fff100;
}
</style>

<style>
  .set-user-form .el-form-item__label{
    border-right: 1px solid #b9c2cb;
    color: #344b50;
    background: #F2F2F2;
    font-size:13px;
    height:29px;
  }
  .set-user-form .el-input{
    height:25px;
  }
  .set-user-form .el-form-item__content{
    padding-left: 20px;
  }
  .set-user-form .el-input .el-input__inner{
    height:25px;
  }
  .set-user-form .el-input-number__decrease{
    height:25px;
    line-height: 25px;
  }

  .baseOdd-bottom .el-form-item__content{
    margin: 0 !important;
  }
  .set-user-form .el-select__caret{
    margin-top: 4px;
  }
</style>
